package com.ruoyi.buss.file.controller;

import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.buss.file.service.FileService;

@RestController
@RequestMapping("/file")
public class FileController {

    @Autowired
    private FileService fileService;
    
    @RequestMapping(value = "/view", method = RequestMethod.GET)
    public void view(HttpServletResponse response,String fileName) {
    	fileService.view(response,fileName);
    }

    @RequestMapping("/file")
    public void file(HttpServletResponse response, @RequestParam("filePath") String filePath)
    {
        fileService.download(response, filePath);
    }
}
